import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 待办事项 */
export const getToDoList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/todo/count"), {
    params: filerEmptyVal(params)
  });
};

/** 添加典型成果 */
export const addToatlAchiev = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/index/add"), { data });
};

/** 删除典型成果 */
export const delToatlAchiev = (id?: number) => {
  return http.request<any>("post", baseUrlApi("/index/delete?id=" + id));
};

/** 典型成果列表 */
export const getTotalAchiev = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/page"), {
    params: filerEmptyVal(params)
  });
};

/** 我的科研 */
export const getMineResearch = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/mine/count"), {
    params: filerEmptyVal(params)
  });
};

/** 团队科研成果积分排名列表 */
export const getTeamKycgRange = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/team/score/total/page"), {
    params: filerEmptyVal(params)
  });
};

/** 团队月度科研积分增长最快排名列表 */
export const getTeamYdkyRange = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/team/score/range/page"), {
    params: filerEmptyVal(params)
  });
};

/** 个人年度或个人月度积分列表 */
export const getPersonScoreList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/user/score/range/page"), {
    params: filerEmptyVal(params)
  });
};

/** 总积分列表 */
export const getTotalScoreList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/index/user/score/total/page"), {
    params: filerEmptyVal(params)
  });
};
